package com.ruoyi;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@EnableScheduling
public class ForYouApplication
{
    public static String activeProfile;

    @Value("${spring.profiles.active}")
    public void setActiveProfile(String activeProfile) {
        ForYouApplication.activeProfile = activeProfile;
    }
    public static void main(String[] args)
    {
        SpringApplication.run(ForYouApplication.class, args);
        System.out.println("启动成功。");
        String activeProfileName = ForYouApplication.activeProfile.equals("dev")?"开发环境":"生产环境";
        System.out.println("已加载配置: "+ activeProfileName +" : application-"+activeProfile);

    }
}
